package com.example.eddie.test.activity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.CardView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.example.eddie.test.R;

import cn.pedant.SweetAlert.SweetAlertDialog;

/**
 * Created by eddie on 2017/7/29.
 */

public class SecFragment extends Fragment {

    private SweetAlertDialog pDialog;
    private CardView cardView_teacher;
    private CardView cardView_classroom;
    private CardView cardView_class;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view= inflater.inflate(R.layout.fragment02, container, false);

        init(view);

        return view;
    }

    private void init(View view) {
        ImageView imageView1 = (ImageView) view.findViewById(R.id.kk1);
        ImageView imageView2 = (ImageView) view.findViewById(R.id.kk2);
        ImageView imageView3 = (ImageView) view.findViewById(R.id.kk3);
        Glide.with(getActivity())
                .load("http://imgsrc.baidu.com/forum/pic/item/70ee8d1001e93901d37fcd5771ec54e736d19615.jpg")
                .into(imageView1);
        Glide.with(getActivity())
                .load("http://imgsrc.baidu.com/forum/pic/item/f7c5b2119313b07e1708116106d7912396dd8cdd.jpg")
                .into(imageView2);
        Glide.with(getActivity())
                .load("http://imgsrc.baidu.com/forum/pic/item/291ad42a2834349bc8b32fecc3ea15ce37d3bedd.jpg")
                .into(imageView3);

        cardView_teacher = view.findViewById(R.id.cardView_teacher);
        cardView_classroom = view.findViewById(R.id.cardView_classroom);
        cardView_class = view.findViewById(R.id.cardView_class);

        cardView_teacher.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(),GetTeacherClass.class));
            }
        });
        cardView_classroom.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(),GetBuildActivity.class));
            }
        });
        cardView_class.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(),StudentActivity.class));
            }
        });
    }

}
